<?php
/**
 * Created by PhpStorm.
 * User: liangjianbiao
 * Date: 2019/1/31
 * Time: 14:49
 */
namespace App\Http\Controllers;

use App\Http\Controllers\Controller;
use GuzzleHttp\Client;
use App\Events\Event;
use App\Models\User;

class TestController extends Controller
{
    public function test()
    {
        $user = User::find(1);
        event(new Event($user));
        echo 'aa';

        /*phpinfo();
        $text = '名称';*/
        /*$http = new Client;
        $api = 'http://api.fanyi.baidu.com/api/trans/vip/translate?';
        $appid = config('services.baidu_translate.appid');
        $key = config('services.baidu_translate.key');
        $salt = time();

        $sign = md5($appid . $text . $salt . $key);
        $query = http_build_query([
            'q' => $text,
            'from' => 'zh',
            'to' => 'en',
            'appid' => $appid,
            'salt' => $salt,
            'sign' => $sign,
        ]);
        $response = $http->get($api.$query);
        var_dump($response);
        $result = json_decode($response->getBody(), true);
        var_dump($result);*/
    }
}